MFont – A list of modular font controls.


Draw text to the screen:

MFont_Text(x, y, text$)

Draws text to the screen.


MFont_Text_Center(x, y, text$)

Draws text to the screen, horizontally centered on given coordinates.


MFont_Text_CenterShadow(x, y, text$)

Draws shadowed text to the screen, horizontally centered on given coordinates.


MFont_Text_Confined(x, y, pixelwidth, text$)

Draws text to the screen, limited by given width in pixels.


MFont_Text_ConfinedShadow(x, y, pixelwidth, text$)

Draws shadowed text to the screen, limited by given width in pixels.


MFont_Text_Shadow(x, y, text$)

Draws shadowed text to the screen.


MFont_Text_MultiLine(x, y, pixelwidth, pixelheight, text$)

Draws text to the screen, limited by given width/height in pixels. Ascii char 10 is new line.


MFont_Text_MultiLineShadow(x, y, pixelwidth, pixelheight, text$)

Draws shadow text to the screen, limited by given width/height in pixels. Ascii char 10 is new line.



Change text attributes:

MFont_GetColor()

Returns the current text color.


MFont_SetAlpha(alphavalue)

Sets the transparency of the text. 0-255


MFont_SetColor(color)

Sets the color of the text. ARGB format.


MFont_SetKerning(value#)

Sets the character spacing for the currently selected font type.


MFont_SetSize(fontsize)

Sets the size of the text in pixels.


MFont_SetType(fonttype)

Sets the font type. By default this is 0-10.



Fast Draw System – Automated text to image:

MFont_FastDraw_Enable()

Enables the automatic fast draw text caching system. Up to 100 recent draw requests will be converted gradually into images so they draw faster. Flushes images from cache after 5 seconds unused.


MFont_FastDraw_Disable()

Disables the automatic fast draw text caching system. Text drawing will use standard MFont system.



Convert text to image:

MFont_CreateImage_Text(textstring$)

Returns image index. Converts text to image. 0=error; image index


Mfont_CreateImage_TextConfined(textstring$, pixelwidth)

Returns image index. Converts text to image, confined by pixelwidth. 0=error; image index


Mfont_CreateImage_TextConfinedShadow(textstring$, pixelwidth)

Returns image index. Converts shadow text to image, confined by pixelwidth. 0=error; image index


Mfont_CreateImage_TextShadow(textstring$, pixelwidth)

Returns image index. Converts shadow text to image. 0=error; image index



Inline Icons:

MFont_AddIcon(filepath$)

Returns icon index (not an image index). Loads image into icon system as icon.



Inline Color Codes – Text that changes color within the same sentence:

MFont_InlineColor_Enable()

Enables the inline color code system for use with existing MFont text commands.


MFont_InlineColor_Disable()

Disables the inline color code system.


Inline Color Code Format:


This system uses ARGB or RGB hexadecimal codes enclosed in curly brackets.

{AARRGGBB} or {RRGGBB}

White: {FFFFFFFF}, Black: {00000000}, Red: {00FF000000},

Green: {0000FF00}, Blue: {000000FF}


Use empty brackets to terminate the color {}. This will revert the color to the currently set primary text color which is set by MFont_SetColor().


So the proper use of this would be: {FF00FF00}Geen Text{}


This system also supports inline icons. Icons also use hexadecimal codes.

Where XX is the numbered index of the icon:

{XX}